package com.juc.forkJoinPool.forkJoinPool3;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ForkJoinTask;

public class Run {
    // public void execute(ForkJoinTask<?> task)处理返回值
	public static void main(String[] args) throws InterruptedException, ExecutionException {
		MyRecursiveTask task  = new MyRecursiveTask();
		ForkJoinPool pool  = new ForkJoinPool();
		pool.execute(task);
		//execute()无返回值
		//想取得返回值得通过
		//RecursiveTask对象
		System.out.println(System.currentTimeMillis());
		System.out.println(task.get());
		System.out.println(System.currentTimeMillis());
		Thread.sleep(5000);
	}
}
